package bhoost.shell;

import android.os.Parcel;
import android.os.Parcelable;

public class XMPPMessage implements Parcelable {
  public int messageType;
  public String sender;
  public String body;
  public String receiver;
  public String chatroom;
  public String type;
  public String url;
  public long time;

  public static final Parcelable.Creator<XMPPMessage> CREATOR = new Parcelable.Creator<XMPPMessage>() {
      public XMPPMessage createFromParcel(Parcel in) {
          return new XMPPMessage(in);
      }

      public XMPPMessage[] newArray(int size) {
          return new XMPPMessage[size];
      }
  };

  public XMPPMessage() {
  }

  private XMPPMessage(Parcel in) {
      readFromParcel(in);
  }

  public void writeToParcel(Parcel out) {
      out.writeInt(messageType);
      out.writeString(sender);
      out.writeString(body);
      out.writeString(receiver);
      out.writeString(chatroom);
      out.writeLong(time);
      out.writeString(type);
      out.writeString(url);
  }

  public void readFromParcel(Parcel in) {
      messageType = in.readInt();
      sender = in.readString();
      body = in.readString();
      receiver = in.readString();
      chatroom = in.readString();
      time = in.readLong();
      type = in.readString();
      url = in.readString();
  }
}